#ifndef IGSLIB_CPACKET_H
#define IGSLIB_CPACKET_H

#include <set>
#include <vector>
#include "igslib_ipacket.h"


namespace igslib 
{
	class CPacket:public IPacket
	{
        protected:
            std::vector<char> buf;
        public:
            enum field
            {
                header,
                length,
                data,
				u8check,
                count,
            };
            CPacket();
            virtual int GetHeaderID() ;
            virtual void SetHeaderID(const int&) ;
            virtual void SetData(const std::vector<char>&) ;
            virtual std::vector<char> GetData() ;
            virtual int GetSelfUniqueID() ;
            virtual int GetUniqueID(const std::vector<char>&) ;
            virtual char GetSelfu8Checksum() ;
            virtual char Getu8Checksum(const std::vector<char>&) ;
            virtual std::vector<char> GetWholePacket() ;
            virtual int ImportRawData(const char*) ;
	};
    class CPacketManager:public IPacketManager
    {
        static IPacketManager* instance;
        public:
            static IPacketManager* GetInstance();
            virtual IPacket* NewPacket();
            virtual std::vector<IPacket*> NewPacketsWithRawData(const char*,const int&);

    };
};

#endif

